-
Notifications
You must be signed in to change notification settings - Fork 2
feat :: 우주 탐사 관리 시스템 - 탐사대원의 정보, 탐사선 정보 입력 및 출력 #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
second/src/Spaceship.java
Outdated
|
|
||
| public class Spaceship { | ||
| private String spaceshipName; //탐사선이름 | ||
| private String spaceshipHumanStatus; //탐사선이 무인인지 유인인지 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enum이라는 타입도 있으니 공부해 보시고 코드 개선해 보아도 좋을 것 같습니다!
second/src/Spaceship.java
Outdated
| private List<Astronaut> astronauts = new ArrayList<>(); //탑승한 탐사 대원 리스트 | ||
|
|
||
| Spaceship(){} | ||
|
|
||
| Spaceship(String spaceshipName, String spaceshipHumanStatus){ | ||
| this.spaceshipName = spaceshipName; | ||
| this.spaceshipHumanStatus = spaceshipHumanStatus; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
무인 우주선일 때는 리스트를 생성할 필요가 없으니 생성자에서 조건문을 사용해서 리스트 생성 로직을 분리해도 좋을 것 같습니다!
|
적어주신 질문에 대해서 좀 더 자세히 설명해 주실 수 있으실까요? |
second/src/Spaceship.java
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
무인과 유인에 따라서 변수가 필요없을 때도 있고 메서드 추가 조건문이 붙을 때도 있으니 상속을 사용해서 우주선 클래스를 만들고 무인선, 유인선 클래스를 각각 만들어서 우주선 클래스를 상속 받으면 좋을 것 같습니다!
과제를 진행하면서 느낀 것이라면 무엇이든 적어주세요, 고민, 이슈, 질문 등 다 좋습니다!
예를들어서 제가 vsc에서 test라는 폴더에 처음에는 a라는 파일만 만들어서 커밋하고 다음에는 b라는 파일을 만들어서 원래하듯히 커밋을 하려면 오류가 뜨는데 이런 경우에는 어떻게 해야하나요?